Optimal. Leaf size=88 \[ \frac{d (2 b c-a d) (a+b x)^{n+1}}{b^2 (n+1)}+\frac{d^2 (a+b x)^{n+2}}{b^2 (n+2)}-\frac{c^2 (a+b x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{b x}{a}+1\right )}{a (n+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0448251, antiderivative size = 88, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {88, 65} \[ \frac{d (2 b c-a d) (a+b x)^{n+1}}{b^2 (n+1)}+\frac{d^2 (a+b x)^{n+2}}{b^2 (n+2)}-\frac{c^2 (a+b x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{b x}{a}+1\right )}{a (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 88
Rule 65
Rubi steps
\begin{align*} \int \frac{(a+b x)^n (c+d x)^2}{x} \, dx &=\int \left (-\frac{d (-2 b c+a d) (a+b x)^n}{b}+\frac{c^2 (a+b x)^n}{x}+\frac{d^2 (a+b x)^{1+n}}{b}\right ) \, dx\\ &=\frac{d (2 b c-a d) (a+b x)^{1+n}}{b^2 (1+n)}+\frac{d^2 (a+b x)^{2+n}}{b^2 (2+n)}+c^2 \int \frac{(a+b x)^n}{x} \, dx\\ &=\frac{d (2 b c-a d) (a+b x)^{1+n}}{b^2 (1+n)}+\frac{d^2 (a+b x)^{2+n}}{b^2 (2+n)}-\frac{c^2 (a+b x)^{1+n} \, _2F_1\left (1,1+n;2+n;1+\frac{b x}{a}\right )}{a (1+n)}\\ \end{align*}
Mathematica [A] time = 0.0554464, size = 77, normalized size = 0.88 \[ -\frac{(a+b x)^{n+1} \left (b^2 c^2 (n+2) \, _2F_1\left (1,n+1;n+2;\frac{b x}{a}+1\right )+a d (a d-b (2 c (n+2)+d (n+1) x))\right )}{a b^2 (n+1) (n+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.03, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( bx+a \right ) ^{n} \left ( dx+c \right ) ^{2}}{x}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left (d^{2} x^{2} + 2 \, c d x + c^{2}\right )}{\left (b x + a\right )}^{n}}{x}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 7.63977, size = 386, normalized size = 4.39 \begin{align*} - \frac{b^{n} c^{2} n \left (\frac{a}{b} + x\right )^{n} \Phi \left (1 + \frac{b x}{a}, 1, n + 1\right ) \Gamma \left (n + 1\right )}{\Gamma \left (n + 2\right )} - \frac{b^{n} c^{2} \left (\frac{a}{b} + x\right )^{n} \Phi \left (1 + \frac{b x}{a}, 1, n + 1\right ) \Gamma \left (n + 1\right )}{\Gamma \left (n + 2\right )} + 2 c d \left (\begin{cases} a^{n} x & \text{for}\: b = 0 \\\frac{\begin{cases} \frac{\left (a + b x\right )^{n + 1}}{n + 1} & \text{for}\: n \neq -1 \\\log{\left (a + b x \right )} & \text{otherwise} \end{cases}}{b} & \text{otherwise} \end{cases}\right ) + d^{2} \left (\begin{cases} \frac{a^{n} x^{2}}{2} & \text{for}\: b = 0 \\\frac{a \log{\left (\frac{a}{b} + x \right )}}{a b^{2} + b^{3} x} + \frac{a}{a b^{2} + b^{3} x} + \frac{b x \log{\left (\frac{a}{b} + x \right )}}{a b^{2} + b^{3} x} & \text{for}\: n = -2 \\- \frac{a \log{\left (\frac{a}{b} + x \right )}}{b^{2}} + \frac{x}{b} & \text{for}\: n = -1 \\- \frac{a^{2} \left (a + b x\right )^{n}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} + \frac{a b n x \left (a + b x\right )^{n}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} + \frac{b^{2} n x^{2} \left (a + b x\right )^{n}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} + \frac{b^{2} x^{2} \left (a + b x\right )^{n}}{b^{2} n^{2} + 3 b^{2} n + 2 b^{2}} & \text{otherwise} \end{cases}\right ) - \frac{b b^{n} c^{2} n x \left (\frac{a}{b} + x\right )^{n} \Phi \left (1 + \frac{b x}{a}, 1, n + 1\right ) \Gamma \left (n + 1\right )}{a \Gamma \left (n + 2\right )} - \frac{b b^{n} c^{2} x \left (\frac{a}{b} + x\right )^{n} \Phi \left (1 + \frac{b x}{a}, 1, n + 1\right ) \Gamma \left (n + 1\right )}{a \Gamma \left (n + 2\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (d x + c\right )}^{2}{\left (b x + a\right )}^{n}}{x}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]